import { ConfluxService } from '@/core/conflux.service';
import { Public } from '@/decorators';
import { ok } from '@/utils';
import { Controller, Get } from '@nestjs/common';
import { BaseController } from './base.controller';

@Controller('conflux')
export class ConfluxController extends BaseController {
  constructor(private readonly confluxService: ConfluxService) {
    super();
  }

  @Public()
  @Get('test')
  async test() {
    return ok(
      await this.confluxService.getBalance(
        'cfxtest:aak2s9c102jm75vts2afz9w3whkb37b45as2xhxu8z',
      ),
    );
  }
}
